package com.example.lynandroidbeta

import android.app.Service
import android.content.Context
import android.content.Intent
import android.os.*
import android.widget.Toast

class MyService : Service() {


    private val handlerThread = HandlerThread("first_handler_thread")


    lateinit var mMessenger: Messenger
    override fun onCreate() {
        super.onCreate()
        handlerThread.start()
    }

    override fun onBind(intent: Intent?): IBinder {
        mMessenger = Messenger(InComingHandlerP(this, handlerThread.looper))
        return mMessenger.binder
    }


    internal class InComingHandlerP(private val context: Context, looper: Looper) :
        Handler(looper)
}